-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic IO #1746
Generic IO #1746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late review!
So I was able to implement the trait in browser.
In general all of this works great, the two things to comes to my mind though:
- Sometimes it is a bit annoying to pass generic IO as last type
namada::ledger::tx::build_transfer::<_, _, _, IO>
, as first three types can be inferred - it would be nice to make prompt and read async. The reason is that when we use those functions in the extension background(service worker) we do not have access to prompt(or any other DOM related features). So to make it work we would have to do something like this: stackblitz. On the other hand though, at the moment we are not using prompts at all, so this might not be such a big issue.
So I can change the order of the generic arguments, but it's a choice of |
cfb57ab
However, I made the |
Ah my bad, I thought they can be skipped the same as in TS 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I noticed apps/src/bin/namada-client/cli.rs
hasn't been deleted yet, despite the module not being referenced from any rust source file.
c855632
* origin/bat/generic-io: [chore]: Merge in 0.21.1 [fix]: Removed unused file [feat]: Changed default io read methods to use tokio's async io tools [feat]: Changed default io read methods to use tokio's async io tools [feat]: Made io reading methods async changelog: add #1746 [chore]: Added IO macros to wallet cli. Renamed to [fix]: Fixed intra-doc link typo [feat]: Made sdk and client io generic
This code replaces IO in sdk and client code with a trait that allows custom IO handling.